package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.SortBean;
import com.common.retrofit.entity.bean.SortDetailsBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class SortDetailsMethods extends BaseMethods {

    private static SortDetailsMethods m_ins = null;

    public static SortDetailsMethods getInstance() {
        if (m_ins == null) {
            synchronized (SortDetailsMethods.class) {
                if (m_ins == null) {
                    m_ins = new SortDetailsMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Category/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void getGoodsBycate(Subscriber<SortDetailsBean> subscriber , int cid , int page) {
        Observable observable = initService().getGoodsBycate(System.currentTimeMillis()+"",
                "19774e8329a376b0a42a1df1ddc415e5",cid, page
        );
        toSubscribe(observable, subscriber);
    }
}
